<template>
	<view class="l_pages">
		<jnavbar title="中奖列表"></jnavbar>
		<me-tabs v-model="current" :tabs="list" active-color="#FFC000"></me-tabs>
		<!-- <u-tabs-swiper ref="uTabs" :list="list" :current="current" @change="tabsChange" :is-scroll="false" :bold="false" swiperWidth="750" active-color="#FFC000"></u-tabs-swiper> -->
		<view class="page_container tab_page_container">
			<swiper class="swiper-box" :current="current" @change="swiperChange">
				<swiper-item v-for="(tab, i) in list" :key="i">
					<ListItem
						:selectstoredata="selectstoredata"
						:store_id="store_id"
						:address="address"
						ref="mescrollItem"
						:i="i"
						:index="current"
						:tabs="list"
						:height="height"
					></ListItem>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>

<script>
import util from '@/common/util.js';
import {mapState, mapMutations} from 'vuex';
import ListItem from './list_item.vue';

export default {
	data() {
		return {
			height: 0,
			list: [
				{
					name: '未领取奖品',
					lister: [],
					page: 1,
					receive: 2,
					total: 0,
					isLoadMore: false
				},
				{
					name: '已领取奖品',
					lister: [],
					page: 1,
					receive: 1,
					total: 0,
					isLoadMore: false
				}
			],
			storelist:{},
			store_id: 0,
			// 因为内部的滑动机制限制，请将tabs组件和swiper组件的current用不同变量赋值
			current: 0, // tabs组件的current值，表示当前活动的tab选项
			swiperCurrent: 0, // swiper组件的current值，表示当前那个swiper-item是活动的
			address: null,
			selectstoredata: {
				name: '请选择门店',
				address: '',
				district: ''
			}
		};
	},
	components: {
		ListItem
	},
	onLoad() {
		this.height = uni.getSystemInfoSync().windowHeight - uni.upx2px(80) + 'px';
	},
	onPullDownRefresh() {},
	methods: {
		swiperChange(e) {
			this.current = e.detail.current;
		},
		// tabs通知swiper切换
		tabsChange(index) {
			this.swiperCurrent = index;
		},
		// 门店选择返回
		Editcart(item, id) {
			this.store_id = item.id;
		}
	}
};
</script>

<style lang="scss" scoped>
.swiper-box {
	height: 100%;
}
</style>
